<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';

$zbp->Load();
$action='root';
if (!$zbp->CheckRights($action)) {$zbp->ydblogError(6);die();}
if (!$zbp->CheckPlugin('ydblog')) {$zbp->ydblogError(48);die();}

if($_GET['type'] == 'weixin' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/ydblog/style/img/wx.jpg');

			}
		}
	}
	$zbp->SetHint('good','修改成功');
	Redirect('main.php?act=a');
}
if($_GET['type'] == 'singletitlelogo' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/ydblog/style/img/singletitlelogo.png');

			}
		}
	}
	$zbp->SetHint('good','修改成功');
	Redirect('main.php?act=a');
}
if($_GET['type'] == 'logo' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/ydblog/style/img/logo.png');

			}
		}
	}
	$zbp->SetHint('good','修改成功');
	Redirect('main.php?act=a');
}
if($_GET['type'] == 'favicon' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/ydblog/style/img/favicon.ico');

			}
		}
	}
	$zbp->SetHint('good','修改成功');
	Redirect('main.php?act=a');
}


//*****幻灯片保存********
if($_GET['type'] == 'slidea' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide1.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=e');
}
if($_GET['type'] == 'slideb' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide2.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=e');
}
if($_GET['type'] == 'slidec' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide3.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=e');
}
if($_GET['type'] == 'slided' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide4.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=e');
}
if($_GET['type'] == 'slidee' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide5.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=e');
}

//****首页六小图******
if($_GET['type'] == 'slideaa' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide11.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=f');
}
if($_GET['type'] == 'slidebb' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide22.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=f');
}
if($_GET['type'] == 'slidecc' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide33.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=f');
}
if($_GET['type'] == 'slidedd' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide44.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=f');
}
if($_GET['type'] == 'slideee' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide55.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=f');
}
if($_GET['type'] == 'slideff' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide66.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=f');
}

//****首页右下导航三图*
if($_GET['type'] == 'slideaaa' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide111.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=h');
}
if($_GET['type'] == 'slidebbb' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide222.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=h');
}
if($_GET['type'] == 'slideccc' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/diy/slide333.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=h');
}
//*********首页左下小图(最多6个)保存******

if($_GET['type'] == 'slideaaaa' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/img/indexleft1.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=i');
}
if($_GET['type'] == 'slidebbbb' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/img/indexleft2.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=i');
}
if($_GET['type'] == 'slidecccc' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/img/indexleft3.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=i');
}
if($_GET['type'] == 'slidedddd' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/img/indexleft4.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=i');
}
if($_GET['type'] == 'slideeeee' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/img/indexleft5.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=i');
}
if($_GET['type'] == 'slideffff' ){
	global $zbp;
	foreach ($_FILES as $key => $value) {
		if(!strpos($key, "_php")){
			if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
				$tmp_name = $_FILES[$key]['tmp_name'];
				$name = $_FILES[$key]['name'];
				@move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/'.$blogtheme.'/style/img/indexleft6.jpg');

			}
		}
	}
	$zbp->SetHint('good','成功');
	Redirect('main.php?act=i');
}

if($_GET['type'] == 'cache' ){
	ydblog_page_archive_cache();
	ydblog_page_tagss_cache();
	ydblog_page_readers_cache();
	
	//ydblog_include_new();
	ydblog_include_hot();
	ydblog_include_rand();
	ydblog_module_Rand();
	$zbp->SetHint('good','已缓存');
	Redirect('./main.php?act=a');
}
?>